package com.dkm.orproject.dkmoa.dao;

import com.dkm.orproject.dkmoa.domain.OaJurisdictionRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface OaJurisdictionRoleMapper {
    /**
     * 根据id删除 角色关联
     * @param pkJurisdictionRoleId 权限角色关联id
     * @return 是否删除成功
     */
    int deleteByPrimaryKey(Long pkJurisdictionRoleId);
    /**
     * 增加角色关联
     * @param record 角色关联
     * @return 成功与否
     */
    int insertSelective(OaJurisdictionRole record);

    /**
     * 查询某一关联下的角色
     * @param pkJurisdictionRoleId 角色关联
     * @return
     */
    OaJurisdictionRole selectByPrimaryKey(Long pkJurisdictionRoleId);
    /**
     * 更新
     * @param record
     * @return
     */
    int updateByPrimaryKeySelective(OaJurisdictionRole record);

    /**
     * 查看所有权限
     * @return
     */
    List<OaJurisdictionRole> findAll();

    /**
     * 批量关联
     * @param jurisdictionRoles
     */
    int insertAll(@Param("list") List<OaJurisdictionRole> jurisdictionRoles);

    List<Long> findByIds(Long roleId);

    /**
     * 根据id 删除表格中的权限
     * @param roleId
     * @return 影响的行数
     */
    int deleteById(Long roleId);
}